package com.kaiwukj.android.ufamily.mvp.ui.page.dynamic.shield;

import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.kaiwukj.android.ufamily.R;
import com.kaiwukj.android.ufamily.mvp.http.entity.result.ShieldResult;

import org.jetbrains.annotations.NotNull;

import java.util.ArrayList;

public class ShieldListAdapter extends BaseQuickAdapter<ShieldResult, BaseViewHolder> {
    public ShieldListAdapter() {
        super(R.layout.item_shield_list, new ArrayList<>());
        addChildClickViewIds(R.id.btn_shield_cancel);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder holder, ShieldResult result) {
        ImageView ivAvatar = holder.getView(R.id.iv_avatar);
        Glide.with(getContext())
                .load(result.getHeadImg())
                .into(ivAvatar);
        holder.setText(R.id.tv_desc, result.getSignature());
        holder.setText(R.id.tv_name, result.getNickname());

    }
}
